<?php
namespace app\common\model;
use think\Model;
class Guarantee extends Base
{
   protected $autoCheckFields = true;

   public  function getGuaranteeInfo($id){
      $where['id'] = $id;
      $info = $this->field("a.id,a.cid,a.title,a.buyer,a.seller,a.free_type,a.buyer_pay,a.seller_get,a.status,a.price,a.free_ratio,b.cname")->alias('a')->join("guarantee_category b","a.cid = b.cid","LEFT")->where($where)->find();
      return $info;
   }

   // public function getStatusAttr($value)
   //  {

   //      $status = [0=>'未审核',1=>'审核通过',2=>'拒绝'];
   //      return $status[$value];
   //  }
   // public function getTradeStatusAttr($value)
   //  {
 	
   //      $status = [0=>'买家未付款',1=>'买家已付款,双方交易中',2=>'确认收货交易结束',3=>'申请纠纷处理',4=>'平台介入处理中'];
   //      return $status[$value];
   //  }
}
